package com.bookmarket.service.impl;

import com.bookmarket.dao.HJHLoginMapper;
import com.bookmarket.entity.Admin;
import com.bookmarket.service.HJHLoginService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.Set;

@Service("/hJHLoginServices")
public class HjHLoginServiceImpl implements HJHLoginService{

    @Resource
    private HJHLoginMapper hJHLoginMapper;


    public Admin findUserByUserName(String name) {
        return hJHLoginMapper.findUserByUserName(name);
    }


    public Set<String> findRoles(String name) {
        Set<String> rolename=hJHLoginMapper.findRoles(name);
        return rolename;
    }


    public Set<String> findPermissions(String name) {
        Set<String> permissionName=hJHLoginMapper.findPermissions(name);
        return permissionName;
    }

    //查询权限_查询外键
    public int findRole_id(String name){
        return hJHLoginMapper.findRole_id(name);
    }

    //查询权限_根据外键查权限
    public String findRole(int id){
        return hJHLoginMapper.findRole(id);
    }




    public HJHLoginMapper gethJHLoginMapper() {
        return hJHLoginMapper;
    }

    public void sethJHLoginMapper(HJHLoginMapper hJHLoginMapper) {
        this.hJHLoginMapper = hJHLoginMapper;
    }
}